

<template>
	<view style="position: relative;">
		<image :src="imageUrl" mode="widthFix" style="width: 750rpx;" @load="handleImageLoad" v-if="imageUrl" />
	    <!-- <view class="fuwuxiang" @click="gotofuwu()" v-if="id==='6'">服务详情</view> -->
		<view v-if="isWechat"
			style="position: fixed;bottom: 0;width: 750rpx;height: 150rpx;background-color: white;display: flex;justify-content: center;align-items: center;z-index: 9999999;">
			<view
				style="height: 80rpx;width: 400rpx;margin: 0 auto;background-color: rgb(9, 103, 252);color:white;display: flex;justify-content: center;align-items: center;font-size: 40rpx;border-radius: 100rpx;"
				@click="tijiao()"><view style="text-align: center;">咨询客服</view></view>
		</view>
	</view>
	
</template>

<script setup>
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app';
	import {
		ref,
		onMounted,

	} from 'vue';

	// 定义响应式变量  
	const imageUrl = ref(''); // 图片地址  
	const imageLoaded = ref(false); // 图片加载状态  
    const isWechat = ref(false)
	// 使用 onMounted 钩子设置图片的 URL  
	const id = ref("")
	onLoad((options) => {
		id.value = options.id
		console.log(options.id, "1", imageUrl)
		if (id.value === "1") {
			//医疗折扣权益金
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E6%99%AE%E6%83%A0%E5%8D%A1/%E5%8C%BB%E7%96%97%E6%8A%98%E6%89%A3%E6%9D%83%E7%9B%8A%E9%87%91-1738831954.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1738831896%3B4892431956&q-key-time=1738831896%3B4892431956&q-header-list=host&q-url-param-list=&q-signature=940d811082c870cd666a9a2e68d941fb93c83d37"
		} else if (id.value === "2") {
			//MDT多学科会诊
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E6%99%AE%E6%83%A0%E5%8D%A1/9d58562cbf0bdcb7acfb57deed1e595-1738943790.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1738943731%3B4892543791&q-key-time=1738943731%3B4892543791&q-header-list=host&q-url-param-list=&q-signature=76b6d869f2b0a706dceffb33bcb9a3ee651eab16"
		} else if (id.value === "3") {
			//药械包权益金
			imageUrl.value =
				"https://dbdgtech-1325115897.cos.ap-shanghai.myqcloud.com/%E6%99%AE%E6%83%A0%E5%8D%A1/66d8195d6390538b5c316eb9bafba72-1738986046.png?q-sign-algorithm=sha1&q-ak=AKIDjfq5IXuJnK0gU5eH65jRHH85GHD0e990&q-sign-time=1738985987%3B4892586047&q-key-time=1738985987%3B4892586047&q-header-list=host&q-url-param-list=&q-signature=8553c223fe3ae23e6f505239c1500b826ecee785"
		} 
	})
	onMounted(() => {
          ready()
	})
	const gotofuwu = () => {
		uni.navigateTo({
			url:"/pages/invite/serveritem"
		})
	}
	// 定义处理图片加载的方法  
	const handleImageLoad = () => {
		imageLoaded.value = true;
		// 修改加载状态为已加载  
		console.log('Image loaded successfully');
	};
	const goto = () => {
		uni.navigateTo({
			url: "/pages/invite/serveritem"
		})
	}
	const longPressHandler = () => {
        wx.scanCode({
              scanType: ['qrCode'],
              success: function(res) {
                console.log(res.result);
              }
            });
	}
    const tijiao = () =>{
     window.location.href = "https://work.weixin.qq.com/kfid/kfcca83d37fd4413968"
    }
    function ready() {
        if (window.__wxjs_environment === 'miniprogram') {
            console.log('在小程序内');
			isWechat.value = false
        } else {
            console.log('不在小程序内');
			isWechat.value = true
        }
    }
	
</script>

<style scoped>
	.fuwuxiang {
	  position: fixed;
	  right: 0rpx;
	  top: 10vh;
	  width: 70rpx;
	  background-color: rgb(76, 194, 255);
	  display: flex;
	  border-top-left-radius: 20rpx;
	  border-bottom-left-radius: 20rpx;
	  display: flex;
	  justify-content: center;
	  align-items: center;
	  text-align: center;
	  padding: 10rpx;
	  font-size: 30rpx;
	  border: 5rpx solid rgb(68, 122, 206);
	  font-weight: 1000;
	  color: rgb(31, 78, 120);
	  z-index: 999999;
	  color: rgb(68, 122, 206);
	  text-align: center;
	}

</style>